/******************************************************************************/
/* @ All Rights Reserved Copyright (C) 2014 broada,Ltd                        */
/*                                                                            */
/*  NAME               informix_base_type.h                                   */
/*  NOTE                                                                      */
/*  DATE               2015/08/26 by zhengxd                                  */
/******************************************************************************/
#ifndef _INFORMIX_BASE_TYPE_H_
#define _INFORMIX_BASE_TYPE_H_

#include "frmem.h"
#include "frstr.h"
#include "frcomm.h"
#include "frlist.h"
#include "frhash2.h"
#include "frlog.h"
#include "iconv2utf8.h"
#include "frsutl.h"
#include "frhex_dump.h"

#include "conntrack.h"
#include "module.h"
#include "frct_comm.h"
#include "frdb_cursor.h"
#include "frreport_comm.h"
#include "frbyte_buffer.h"
#include "frtds_convert.h"

#define INFORMIX_HEADER_SIZE                    6
#define INFORMIX_FLT_IEEE_HI                    0
#define INFORMIX_FLT_IEEE_LO                    1
#define INFORMIX_FLT_VAXD                       2
#define INFORMIX_FLT_ND5000                     3

/* version index */
typedef enum __INFORMIX_VER_IDX {
    INFORMIX_USVER_IDX = 0,
    INFORMIX_XPSVER8_40_IDX,
    INFORMIX_FETCHARR_IDX,
    INFORMIX_902_IDX,
    INFORMIX_903_IDX,
    INFORMIX_9301_IDX,
    INFORMIX_90303_IDX,
    INFORMIX_CURSESSINFO_IDX,
    INFORMIX_LVCGTTHAN2KSUPPORTED_IDX,
    INFORMIX_ASF_IDX,
    INFORMIX_GLS_IDX,
    INFORMIX_MULTIPLEUDROUTSUPPORTED_IDX,
    INFORMIX_REMOVE64KLIMITSUPPORTED_IDX,
    INFORMIX_SAVEPOINTSUPPORTED_IDX,
    INFORMIX_IDX9_IDX,
    INFORMIX_IDX10_IDX,
    INFORMIX_IDX18_IDX,
    INFORMIX_DESCRIBEINPUTSUPPORTED_IDX,
    INFORMIX_PRIVATESERVERENABLED_IDX,
    INFORMIX_ONlINE5SER_IDX,
    INFORMIX_NAMEDPARAMETERSSUPPORTED_IDX,
    INFORMIX_PAMAUTHENTICATION_IDX,
    INFORMIX_4BYTEOFFSETSUPPORTED_IDX,
    INFORMIX_BIGINTSUPPORTED_IDX,
    INFORMIX_SQBATCHSUPPORTED_IDX,
    INFORMIX_2GBFETCHBUFFERSUPPORTED_IDX,
    INFORMIX_END_IDX,
} INFORMIX_VER_IDX;

/* message type */
#define INFORMIX_MSG_TP_LOGIN                   255 /* 自定义 */
#define INFORMIX_MSG_TP_COMMAND                 1
#define INFORMIX_MSG_TP_PREPARE                 2
#define INFORMIX_MSG_TP_CURNAME                 3
#define INFORMIX_MSG_TP_ID                      4
#define INFORMIX_MSG_TP_BIND                    5
#define INFORMIX_MSG_TP_OPEN                    6
#define INFORMIX_MSG_TP_EXECUTE                 7
#define INFORMIX_MSG_TP_DESCRIBE                8
#define INFORMIX_MSG_TP_NFETCH                  9
#define INFORMIX_MSG_TP_CLOSE                   10
#define INFORMIX_MSG_TP_RELEASE                 11
#define INFORMIX_MSG_TP_EOT                     12
#define INFORMIX_MSG_TP_ERR                     13
#define INFORMIX_MSG_TP_TUPLE                   14
#define INFORMIX_MSG_TP_DONE                    15
#define INFORMIX_MSG_TP_EXSELECT                16
#define INFORMIX_MSG_TP_PUT                     17
#define INFORMIX_MSG_TP_PUTERR                  18
#define INFORMIX_MSG_TP_CMMTWORK                19
#define INFORMIX_MSG_TP_RBWORK                  20
#define INFORMIX_MSG_TP_SVPOINT                 21
#define INFORMIX_MSG_TP_NDESCRIBE               22
#define INFORMIX_MSG_TP_SFETCH                  23
#define INFORMIX_MSG_TP_SCROLL                  24
#define INFORMIX_MSG_TP_TUPID                   25
#define INFORMIX_MSG_TP_DBLIST                  26
#define INFORMIX_MSG_TP_PCOMMAND                27
#define INFORMIX_MSG_TP_POPEN                   28
#define INFORMIX_MSG_TP_PCLOSE                  29
#define INFORMIX_MSG_TP_PFETCH                  30
#define INFORMIX_MSG_TP_PDELETE                 31
#define INFORMIX_MSG_TP_PUPDATE                 32
#define INFORMIX_MSG_TP_PUEXECUTE               33
#define INFORMIX_MSG_TP_PPUT                    34
#define INFORMIX_MSG_TP_BEGIN                   35
#define INFORMIX_MSG_TP_DBOPEN                  36
#define INFORMIX_MSG_TP_DBCLOSE                 37
#define INFORMIX_MSG_TP_FETCHBLOB               38
#define INFORMIX_MSG_TP_BLOB                    39
#define INFORMIX_MSG_TP_FERR                    40
#define INFORMIX_MSG_TP_BBIND                   41
#define INFORMIX_MSG_TP_DPREPARE                42
#define INFORMIX_MSG_TP_HOLD                    43
#define INFORMIX_MSG_TP_DCATALOG                44
#define INFORMIX_MSG_TP_REMTAB                  45
#define INFORMIX_MSG_TP_REMNAME                 46
#define INFORMIX_MSG_TP_ISOLEVEL                47
#define INFORMIX_MSG_TP_LOCKWAIT                48
#define INFORMIX_MSG_TP_WANTDONE                49
#define INFORMIX_MSG_TP_REMPERMS                51
#define INFORMIX_MSG_TP_SBBIND                  52
#define INFORMIX_MSG_TP_VERSION                 53
#define INFORMIX_MSG_TP_DEFER                   54
#define INFORMIX_MSG_TP_COST                    55
#define INFORMIX_MSG_TP_EXIT                    56
#define INFORMIX_MSG_TP_DLEXIT                  57
#define INFORMIX_MSG_TP_REMPROC                 58
#define INFORMIX_MSG_TP_EXPROC                  59
#define INFORMIX_MSG_TP_REMDML                  60
#define INFORMIX_MSG_TP_TXPREPARE               61
#define INFORMIX_MSG_TP_TXREADONLY              62
#define INFORMIX_MSG_TP_TXFORGET                63
#define INFORMIX_MSG_TP_TXINQUIRE               64
#define INFORMIX_MSG_TP_XROLLBACK               65
#define INFORMIX_MSG_TP_XCLOSE                  66
#define INFORMIX_MSG_TP_XCOMMIT                 67
#define INFORMIX_MSG_TP_XEND                    68
#define INFORMIX_MSG_TP_XFORGET                 69
#define INFORMIX_MSG_TP_XPREPARE                70
#define INFORMIX_MSG_TP_XRECOVER                71
#define INFORMIX_MSG_TP_XSTART                  72
#define INFORMIX_MSG_TP_XERR                    73
#define INFORMIX_MSG_TP_XASTATE                 74
#define INFORMIX_MSG_TP_DESCBIND                75
#define INFORMIX_MSG_TP_REMPPERMS               76
#define INFORMIX_MSG_TP_SETGTRID                77
#define INFORMIX_MSG_TP_MISCFLAGS               78
#define INFORMIX_MSG_TP_TRIGLVL                 79
#define INFORMIX_MSG_TP_NLS                     80
#define INFORMIX_MSG_TP_INFO                    81
#define INFORMIX_MSG_TP_XOPEN                   82
#define INFORMIX_MSG_TP_ARCHIVE                 83
#define INFORMIX_MSG_TP_TXSTATE                 84
#define INFORMIX_MSG_TP_DISTFETCH               85
#define INFORMIX_MSG_TP_REASSOC                 86
#define INFORMIX_MSG_TP_REOPTOPEN               87
#define INFORMIX_MSG_TP_REMUTYPE                88
#define INFORMIX_MSG_TP_PLOAD                   89
#define INFORMIX_MSG_TP_ONASSIST                90
#define INFORMIX_MSG_TP_DDR                     91
#define INFORMIX_MSG_TP_FETARRSIZE              92
#define INFORMIX_MSG_TP_ONUTIL                  93
#define INFORMIX_MSG_TP_INSERTDONE              94
#define INFORMIX_MSG_TP_MIG                     95
#define INFORMIX_MSG_TP_CDR                     96
#define INFORMIX_MSG_TP_LODATA                  97
#define INFORMIX_MSG_TP_FILE                    98
#define INFORMIX_MSG_TP_XACTSTAT                99
#define INFORMIX_MSG_TP_RET_TYPE                100
#define INFORMIX_MSG_TP_GETROUTINE              101
#define INFORMIX_MSG_TP_EXFPROUTINE             102
#define INFORMIX_MSG_TP_FPROUTINE               103
#define INFORMIX_MSG_TP_FPARAM                  104
#define INFORMIX_MSG_TP_RELCOLL                 105
#define INFORMIX_MSG_TP_FILE_READ               106
#define INFORMIX_MSG_TP_FILE_WRITE              107
#define INFORMIX_MSG_TP_AUTOFREE                108
#define INFORMIX_MSG_TP_SERVEROWNER             109
#define INFORMIX_MSG_TP_INTERNALVER             110
#define INFORMIX_MSG_TP_NDESC_ID                111
#define INFORMIX_MSG_TP_CONNECT                 112
#define INFORMIX_MSG_TP_SETCONN                 113
#define INFORMIX_MSG_TP_DISCONNECT              114
#define INFORMIX_MSG_TP_BEGIN_NOREPL            115
#define INFORMIX_MSG_TP_DGETROUTINE             116
#define INFORMIX_MSG_TP_DEXFPROUTINE            117
#define INFORMIX_MSG_TP_DFPARAM                 118
#define INFORMIX_MSG_TP_FP_PROCINFO             119
#define INFORMIX_MSG_TP_GETHIERARCHY            120
#define INFORMIX_MSG_TP_DRAIN_MEM               121
#define INFORMIX_MSG_TP_CALLBACK                122
#define INFORMIX_MSG_TP_UUID                    123
#define INFORMIX_MSG_TP_CIDESCRIBE              124
#define INFORMIX_MSG_TP_IDESCRIBE               125
#define INFORMIX_MSG_TP_PROTOCOLS               126
#define INFORMIX_MSG_TP_ACCEPT                  127
#define INFORMIX_MSG_TP_ACK                     128
#define INFORMIX_MSG_TP_CHALLENGE               129
#define INFORMIX_MSG_TP_RESPONSE                130
//#define INFORMIX_MSG_TP_MAXNUM                  131 //todo 早期版本
#define INFORMIX_MSG_TP_CFPDESCRIBE             131  /* 新版本中追加 */
#define INFORMIX_MSG_TP_IFPDESCRIBE             132  /* 新版本中追加 */
#define INFORMIX_MSG_TP_VPUT                    133  /* 新版本中追加 */
#define INFORMIX_MSG_TP_SGKPREPARE              134  /* 新版本中追加 */
#define INFORMIX_MSG_TP_SGKDESCRIBE             135  /* 新版本中追加 */
#define INFORMIX_MSG_TP_SGKTUPLE                136  /* 新版本中追加 */
#define INFORMIX_MSG_TP_SQLISETSVPT             137  /* 新版本中追加 */
#define INFORMIX_MSG_TP_SQLIRELSVPT             138  /* 新版本中追加 */
#define INFORMIX_MSG_TP_SQLIRBACKSVPT           139  /* 新版本中追加 */
#define INFORMIX_MSG_TP_MAXNUM                  140  /* 新版本中追加 */
#define INFORMIX_MSG_TP_BATCHSTART              141  /* 新版本中追加 */
#define INFORMIX_MSG_TP_BATCHEND                142  /* 新版本中追加 */
#define INFORMIX_MSG_TP_INVOKE                  200
#define INFORMIX_MSG_TP_REPLY                   201
#define INFORMIX_MSG_TP_EXCEPTION               202
#define INFORMIX_MSG_TP_VERSION_REQ             203
#define INFORMIX_MSG_TP_VERSION_REPLY           204
#define INFORMIX_MSG_TP_AMFPARAM                205

#endif
